/*
 * @Author: 
 * @Date: 2022-01-27 10:30:55
 * @LastEditors: lqj
 * @LastEditTime: 2022-02-18 16:15:50
 * @Description: 请填写简介
 */
import React, { Component } from 'react';
import {Input, Button} from 'antd'

class Search extends Component {
  handleSearch = () => {
    const { keyWord: { value }} = this
    if (value.trim() === '') return
    this.props.getDataList(value)
  }
  render() {
    return (
      <div className="jumbotron">
        <h3 className="jumbotron-heading">Search Github Users</h3>
        <div style={{display: 'flex'}}>
          <Input ref={c => this.keyWord = c} type="text" placeholder="enter the name you search" />&nbsp;
          <Button onClick={this.handleSearch}>Search</Button>
        </div>
      </div>
    );
  }
}

export default Search;
